package com.liuwa.knowledge.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.liuwa.common.annotation.DefaultValue;
import com.liuwa.common.annotation.Excel;
import com.liuwa.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户对象 a_user
 * 
 * @author liuwa
 * @date 2023-12-12 16:00:20
 */

@ApiModel(description = "用户对象")
public class User extends BaseEntity<Long> {

    private static final long serialVersionUID = 1L;

    /** 用户ID */
    @Excel(name = "用户ID", sort=0)
    @ApiModelProperty(name="user_id", required = false, value="用户ID")
    private Long userId;

    /** 账号 */
    @Excel(name = "账号", sort=10)
    @ApiModelProperty(name="username", required = true, value="账号")
    private String username;

    /** 昵称 */
    @Excel(name = "昵称", sort=20)
    @ApiModelProperty(name="nick_name", required = true, value="昵称")
    private String nickName;

    /** 头像 */

    @ApiModelProperty(name="avatar", required = true, value="头像")
    private String avatar;

    /** 性别 */

    @DefaultValue
    @ApiModelProperty(name="gender", required = false, value="性别")
    private Integer gender;

    /** 省份 */

    @DefaultValue
    @ApiModelProperty(name="province", required = false, value="省份")
    private String province;

    /** 城市 */
    @DefaultValue
    @ApiModelProperty(name="city", required = true, value="城市")
    private String city;

    /** 手机号 */
    @Excel(name = "手机号", sort=70)
    @ApiModelProperty(name="phone", required = true, value="手机号")
    private String phone;

    /** 邮箱 */

    @ApiModelProperty(name="email", required = true, value="邮箱")
    @DefaultValue
    private String email;

    /** 密码 */

    @ApiModelProperty(name="password", required = true, value="密码")
    private String password;

    /** 密码加盐 */

    @ApiModelProperty(name="salt", required = true, value="密码加盐")
    private String salt;

    /** 钱包 */
    @Excel(name = "剩余Token", sort=110)
    @DefaultValue
    @ApiModelProperty(name="wallet", required = true, value="钱包")
    private BigDecimal wallet;



    /** 会员等级 */

    @ApiModelProperty(name="vip", required = true, value="会员等级")
    @DefaultValue
    private Integer vip;

    /** 会员过期时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(name="vip_expire_at", required = false, value="会员过期时间")
    private Date vipExpireAt;

    /** 密保 */
    @DefaultValue
    @ApiModelProperty(name="security_question", required = true, value="密保")
    private String securityQuestion;

    /** 简介 */
    @DefaultValue
    @ApiModelProperty(name="introduction", required = true, value="简介")
    private String introduction;

    /** 最后登录IP */
    @Excel(name = "最后登录IP", sort=170)
    @DefaultValue
    @ApiModelProperty(name="login_ip", required = false, value="最后登录IP")
    private String loginIp;

    /** 最后登录时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "最后登录时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort=180)
    @ApiModelProperty(name="login_time", required = false, value="最后登录时间")
    private Date loginTime;

    /** 状态 */
    @ApiModelProperty(name="status", required = true, value="状态")
    private Integer status;

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setUsername(String username) 
    {
        this.username = username;
    }

    public String getUsername() 
    {
        return username;
    }

    public void setNickName(String nickName) 
    {
        this.nickName = nickName;
    }

    public String getNickName() 
    {
        return nickName;
    }

    public void setAvatar(String avatar) 
    {
        this.avatar = avatar;
    }

    public String getAvatar() 
    {
        return avatar;
    }

    public void setGender(Integer gender) 
    {
        this.gender = gender;
    }

    public Integer getGender() 
    {
        return gender;
    }

    public void setProvince(String province) 
    {
        this.province = province;
    }

    public String getProvince() 
    {
        return province;
    }

    public void setCity(String city) 
    {
        this.city = city;
    }

    public String getCity() 
    {
        return city;
    }

    public void setPhone(String phone) 
    {
        this.phone = phone;
    }

    public String getPhone() 
    {
        return phone;
    }

    public void setEmail(String email) 
    {
        this.email = email;
    }

    public String getEmail() 
    {
        return email;
    }

    public void setPassword(String password) 
    {
        this.password = password;
    }

    public String getPassword() 
    {
        return password;
    }

    public void setSalt(String salt) 
    {
        this.salt = salt;
    }

    public String getSalt() 
    {
        return salt;
    }

    public void setWallet(BigDecimal wallet) 
    {
        this.wallet = wallet;
    }

    public BigDecimal getWallet() 
    {
        return wallet;
    }

    public void setVip(Integer vip) 
    {
        this.vip = vip;
    }

    public Integer getVip() 
    {
        return vip;
    }

    public void setVipExpireAt(Date vipExpireAt) 
    {
        this.vipExpireAt = vipExpireAt;
    }

    public Date getVipExpireAt() 
    {
        return vipExpireAt;
    }

    public void setSecurityQuestion(String securityQuestion) 
    {
        this.securityQuestion = securityQuestion;
    }

    public String getSecurityQuestion() 
    {
        return securityQuestion;
    }

    public void setIntroduction(String introduction) 
    {
        this.introduction = introduction;
    }

    public String getIntroduction() 
    {
        return introduction;
    }

    public void setLoginIp(String loginIp) 
    {
        this.loginIp = loginIp;
    }

    public String getLoginIp() 
    {
        return loginIp;
    }

    public void setLoginTime(Date loginTime) 
    {
        this.loginTime = loginTime;
    }

    public Date getLoginTime() 
    {
        return loginTime;
    }

    public void setStatus(Integer status) 
    {
        this.status = status;
    }

    public Integer getStatus() 
    {
        return status;
    }

    @Override
    @Excel(name = "注册时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss", sort=190)
    public Date getCreateTime() {
        return super.getCreateTime();
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("username", getUsername())
            .append("nickName", getNickName())
            .append("avatar", getAvatar())
            .append("gender", getGender())
            .append("province", getProvince())
            .append("city", getCity())
            .append("phone", getPhone())
            .append("email", getEmail())
            .append("password", getPassword())
            .append("salt", getSalt())
            .append("wallet", getWallet())
            .append("vip", getVip())
            .append("vipExpireAt", getVipExpireAt())
            .append("securityQuestion", getSecurityQuestion())
            .append("introduction", getIntroduction())
            .append("loginIp", getLoginIp())
            .append("loginTime", getLoginTime())
            .append("status", getStatus())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("delFlag", getDelFlag())
            .toString();
    }
}
